<template>
	<view class="content">
		<view class="con-bg"></view>
		<view class="desc-con" v-if="dataList.detail">
			<image v-if="dataList.image" :src="imgUrl+dataList.image" style="width: 269rpx;" mode="widthFix"></image>
			<view style="margin-top: 23rpx;font-weight: 500;font-size: 38rpx;">
				{{ dataList.doctorName}}
			</view>
			<view style="margin-top: 15rpx;color: #999999;">
				{{dataList.remark}}
			</view>
			<view style="margin-top: 23rpx;line-height: 45rpx;">
				<u-parse :content="dataList.detail"></u-parse>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		imgUrl,
		doctorsInfoApi
	} from "@/api/user"
	export default {
		data() {
			return {
				imgUrl,
				dataList: {}
			}
		},
		onLoad(option) {
			this.getList(option.id)
		},
		methods: {
			async getList(id) {
				uni.showLoading({
					title: '加载中...',
					mask: true
				})
				try {
					const res = await doctorsInfoApi({
						id
					})
					console.log(res);
					this.dataList = res.data
					uni.hideLoading()
				} catch (e) {
					uni.hideLoading()
				}
			},
		}
	}
</script>

<style scoped>
	.content {
		padding-top: 23rpx;
		box-sizing: border-box;
		padding-bottom: calc(23rpx + env(safe-area-inset-bottom));
	}

	.con-bg {
		position: fixed;
		top: 0;
		left: 0;
		z-index: 1;
		width: 100vw;
		height: 100%;
		background-image: url(../../static/img/bg_information_l.png);
		background-repeat: no-repeat;
		background-size: cover;
	}

	.desc-con {
		position: relative;
		z-index: 2;
		margin: 0 auto;
		width: 688rpx;
		background: #FFFFFF;
		border-radius: 19rpx;
		padding: 31rpx;
		box-sizing: border-box;
		color: #000000;
		font-size: 27rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
	}
</style>